-
Notifications
You must be signed in to change notification settings - Fork 8k
treewide: Enforce C17 as the minimum required C standard #97076
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
@stephanosio @nashif @keith-packard should we also enforce C++17 at the same time, for consistency? |
C99 has been the minimum required C standard version for Zephyr since its inception. After multiple attempts and discussions, a decision has been made to upgrade to C17 going forward. This commits replaces the default C standard from C99 to C17 in the configuration and build system. Signed-off-by: Carles Cufi <[email protected]>
As part of the transition from C99 to C17 as the minimum supported C standard version, remove the workarounds in the formatted output subsystem to maintain compatibility with toolchains that do not support the _Generic keyword. Signed-off-by: Carles Cufi <[email protected]>
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to drop these compiler feature flags? This will require all out-of-tree dependencies to drop this (even if they do support an older C standard version?).
I think this can remain, as newer standards should support older flags.
@nashif You may want to consider switching to MISRA C:2012 Amendment 3 as a basis for the guidelines after updating the baseline C standard version, since that edition of the guidelines have much better coverage of C17 than Amendment 2 (e.g. it has guidelines for the safe use of |
C99 has been the minimum required C standard version for Zephyr since its inception. After multiple attempts and discussions, a decision has been made to upgrade to C17 going forward.
This commits replaces the default C standard from C99 to C17 in the configuration and build system.